﻿// --------------------------------------------------------------------------------------------------------------------
// <copyright file="ISPDocumentRepository.cs" company="Collaboris Ltd.">
//   Copyright (c) Collaboris Ltd. All rights Reserved.
// </copyright>
// <summary>
//   Defines the ISPDocumentRepository type.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace Collaboris.DataAccess.SharePoint
{
    using System.IO;

    using Microsoft.SharePoint;

    /// <summary>
    /// Interface to be implemented by all SharePoint document repositories
    /// </summary>
    /// <typeparam name="T">
    /// </typeparam>
    internal interface ISPDocumentRepository<T>
    {
        /// <summary>
        /// The save document.
        /// </summary>
        /// <param name="businessObject">
        /// The business object.
        /// </param>
        /// <param name="documentStream">
        /// The document stream.
        /// </param>
        /// <param name="folder">
        /// The folder.
        /// </param>
        /// <param name="fileName">
        /// The file name.
        /// </param>
        void SaveDocument(T businessObject, Stream documentStream, string folder, string fileName);

        /// <summary>
        /// The save document.
        /// </summary>
        /// <param name="businessObject">
        /// The business object.
        /// </param>
        /// <param name="documentStream">
        /// The document stream.
        /// </param>
        /// <param name="folder">
        /// The folder.
        /// </param>
        /// <param name="fileName">
        /// The file name.
        /// </param>
        /// <param name="user">
        /// The user.
        /// </param>
        void SaveDocument(T businessObject, Stream documentStream, string folder, string fileName, SPUser user);

        /// <summary>
        /// The get document.
        /// </summary>
        /// <param name="itemId">
        /// The item id.
        /// </param>
        /// <returns>
        /// </returns>
        SPFile GetDocument(int itemId);
    }
}